﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Ucb.Workshop.WinApp.View.Reportes.CrystalReports;
using Ucb.Workshop.Dal;

namespace Ucb.Workshop.WinApp.View.GestionProveedor
{
    public partial class ListaProveedores : Form
    {
        public ListaProveedores()
        {
            InitializeComponent();
            cargar_reporte();
        }

        private void cargar_reporte()
        {
            #region consulta gral
            cr_proveedores rep = new cr_proveedores();
            string sConsulta = @"SELECT * FROM proveedor;";
            #endregion
            SqlDataAdapter ad = new SqlDataAdapter(sConsulta, DBManager.Conexion());

            DataSet ds = new DataSet();
            ad.Fill(ds, "proveedor");
            try
            {
                rep.SetDataSource(ds);
                crystalReportViewer1.ReportSource = rep;
                crystalReportViewer1.Visible = true;
                crystalReportViewer1.ShowExportButton = true;

            }
            catch
            { }

            ad.Dispose();
        }


        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {

        }
    }
}
